| Fully Qualified Name: | CodeIgniter\Test\FeatureResponse |
| Extends: | TestCase |
Assertions for a response
| Name | Description | Defined By |
|---|---|---|
| __construct() | Constructor. | FeatureResponse |
| assertCookie() | Asserts that the response has the specified cookie. | FeatureResponse |
| assertCookieExpired() | Asserts that a cookie exists and has an expired time. | FeatureResponse |
| assertCookieMissing() | Assert the Response does not have the specified cookie set. | FeatureResponse |
| assertDontSee() | Asserts that we do not see the specified text. | FeatureResponse |
| assertDontSeeElement() | Assert that we do not see an element selected via a CSS selector. | FeatureResponse |
| assertHeader() | Asserts that the Response contains a specific header. | FeatureResponse |
| assertHeaderMissing() | Asserts the Response headers does not contain the specified header. | FeatureResponse |
| assertJSONExact() | Asserts that the JSON exactly matches the passed in data. | FeatureResponse |
| assertJSONFragment() | Test that the response contains a matching JSON fragment. | FeatureResponse |
| assertOK() | Asserts that the Response is considered OK. | FeatureResponse |
| assertRedirect() | Assert that the given response was a redirect. | FeatureResponse |
| assertSee() | Assert that the desired text can be found in the result body. | FeatureResponse |
| assertSeeElement() | Assert that we see an element selected via a CSS selector. | FeatureResponse |
| assertSeeInField() | Assert that we see an input with name/value. | FeatureResponse |
| assertSeeLink() | Assert that we see a link with the matching text and/or class. | FeatureResponse |
| assertSessionHas() | Asserts that an SESSION key has been set and, optionally, test it's value. | FeatureResponse |
| assertSessionMissing() | Asserts the session is missing $key. | FeatureResponse |
| assertStatus() | Asserts that the status is a specific value. | FeatureResponse |
| getJSON() | Returns the response's body as JSON | FeatureResponse |
| getXML() | Returns the response' body as XML | FeatureResponse |
| isOK() | Boils down the possible responses into a bolean valid/not-valid response type. | FeatureResponse |
| isRedirect() | Returns whether or not the Response was a redirect response | FeatureResponse |
Constructor.
| Parameter Name | Type | Description |
|---|---|---|
| $response | \Response |
Returns:
Asserts that the response has the specified cookie.
| Parameter Name | Type | Description |
|---|---|---|
| $key | string | |
| $value | null | |
| $prefix | string|null |
Returns:
Asserts that a cookie exists and has an expired time.
| Parameter Name | Type | Description |
|---|---|---|
| $key | string | |
| $prefix | string |
Returns:
Assert the Response does not have the specified cookie set.
| Parameter Name | Type | Description |
|---|---|---|
| $key | string |
Returns:
Asserts that we do not see the specified text.
| Parameter Name | Type | Description |
|---|---|---|
| $search | string|null | |
| $element | string|null |
Returns:
Assert that we do not see an element selected via a CSS selector.
| Parameter Name | Type | Description |
|---|---|---|
| $search | string |
Returns:
Asserts that the Response contains a specific header.
| Parameter Name | Type | Description |
|---|---|---|
| $key | string | |
| $value | null |
Returns:
Asserts the Response headers does not contain the specified header.
| Parameter Name | Type | Description |
|---|---|---|
| $key | string |
Returns:
Asserts that the JSON exactly matches the passed in data.
If the value being passed in is a string, it must be a json_encoded string.
| Parameter Name | Type | Description |
|---|---|---|
| $test | string|array |
Returns:
Test that the response contains a matching JSON fragment.
| Parameter Name | Type | Description |
|---|---|---|
| $fragment | array |
Returns:
Asserts that the Response is considered OK.
Returns:
Assert that the given response was a redirect.
Returns:
Assert that the desired text can be found in the result body.
| Parameter Name | Type | Description |
|---|---|---|
| $search | string|null | |
| $element | string|null |
Returns:
Assert that we see an element selected via a CSS selector.
| Parameter Name | Type | Description |
|---|---|---|
| $search | string |
Returns:
Assert that we see an input with name/value.
| Parameter Name | Type | Description |
|---|---|---|
| $field | string | |
| $value | string|null |
Returns:
Assert that we see a link with the matching text and/or class.
| Parameter Name | Type | Description |
|---|---|---|
| $text | string | |
| $details | string|null |
Returns:
Asserts that an SESSION key has been set and, optionally, test it's value.
| Parameter Name | Type | Description |
|---|---|---|
| $key | string | |
| $value | null |
Returns:
Asserts the session is missing $key.
| Parameter Name | Type | Description |
|---|---|---|
| $key | string |
Returns:
Asserts that the status is a specific value.
| Parameter Name | Type | Description |
|---|---|---|
| $code | int |
Returns:
Returns the response's body as JSON
Returns: mixed|bool
Returns the response' body as XML
Returns: mixed|string
Boils down the possible responses into a bolean valid/not-valid response type.
Returns: bool
Returns whether or not the Response was a redirect response
Returns: bool